import { observable, computed, action } from 'mobx';
import ApiHelper from './ApiHelper';
import { broker_list_mini } from '../constants/ApiTypes';

class BrokerListMini {
    
    @observable info = [];
    @action async getInfo(store_id = false) {
        let data = {};
        if (store_id) data.store_id = store_id;
        const result = await ApiHelper.requestPost(broker_list_mini, data);
        if (result.status) {
            this.info = result.info;
            return true;
        } else {
            this.info = [];
            return false;
        }
    }
}

export default new BrokerListMini;